﻿using System.Data;

namespace Codemonk.Common.Data
{
    public interface IExecuteScalarQueryable
    {
        object ExecuteScalar(IDbConnection connetion, string cmdtext, params IDataParameter[] paras);

        object ExecuteScalar(IDbConnection connetion, string cmdtext, DbParameterBuilder builder);

        object ExecuteScalar<T>(IDbConnection connetion, string cmdtext, DbParameterBuilder<T> builder) where T : IDataParameter, new();

        object ExecuteScalar(string cmdtext, params IDataParameter[] paras);

        object ExecuteScalar(string cmdtext, DbParameterBuilder builder);

        object ExecuteScalar<T>(string cmdtext, DbParameterBuilder<T> builder) where T : IDataParameter, new();

        object ExecuteScalar(IDbCommand cmd);

        R ExecuteScalar<R>(IDbConnection connetion, string cmdtext, params IDataParameter[] paras);

        R ExecuteScalar<R>(IDbConnection connetion, string cmdtext, DbParameterBuilder builder);

        R ExecuteScalar<R, T>(IDbConnection connetion, string cmdtext, DbParameterBuilder<T> builder) where T : IDataParameter, new();

        R ExecuteScalar<R>(string cmdtext, params IDataParameter[] paras);

        R ExecuteScalar<R>(string cmdtext, DbParameterBuilder builder);

        R ExecuteScalar<R, T>(string cmdtext, DbParameterBuilder<T> builder) where T : IDataParameter, new();

        R ExecuteScalar<R>(IDbCommand cmd);
    }
}
